<?php
/**
 * Created by Ling.
 * User: Ling
 * Date: 2020/9/2
 * Time:16:34
 * @email: L_ing1992@163.com
 */

namespace App\Utils\Kingdb;


use Illuminate\Database\Connection;
use Illuminate\Support\ServiceProvider;

class KingdbServiceProvider extends ServiceProvider
{

    public function boot()
    {
    }

    public function register()
    {
        $this->app->bind('db.connector.kdb', function () {
            return new KingdbConnector;
        });

        Connection::resolverFor('kdb', function ($connection, $database, $prefix, $config){
            return new KingdbConnection($connection, $database, $prefix, $config);
        });
    }

}
